using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NiMVC;
using UnityEngine;
using UnityEngine.Networking;

[CreateAssetMenu(fileName = "艺术字体配置", menuName = "创建数据/艺术字体配置")]
// [Model("Assets/数据配置/主界面地图配置.xlsx")]
public class 艺术字Model : BaseModel<艺术字体>
{
    
    public List<艺术字体.字体> GetValues(string keys, Enum艺术字key枚举 fit字体)
    {
        艺术字体 ziti;
        var all字体 = Datas;
        int index = all字体.FindIndex(f => f.type == fit字体);
        if (index < 0)
        {
            Debug.LogError($"找不到字体配置{fit字体}");
            index = all字体.FindIndex(f => f.type == Enum艺术字key枚举.主界面Test);
        }

        ziti = all字体[index];
        List<艺术字体.字体> res = new List<艺术字体.字体>();
        Dictionary<int, char> dictKeys = new Dictionary<int, char>();
        int i = 0;
        foreach (var VARIABLE in keys)
        {
            var v = ziti.all字.FirstOrDefault(f => f.key == VARIABLE.ToString());
            if(v==null) continue;
            res.Add(v);
        }
        
        return res;
    }
    
}

[Serializable]
public class 艺术字体: IModelData
{
    public int Id;
    public List<字体> all字 = new List<字体>();
    public Enum艺术字key枚举 type;
    [Serializable]
    public class 字体
    {
        public string key;
        public Sprite value;
        public int x;//
        public int y;
    }

    public int GetId()
    {
        return Id;
    }
}


public enum Enum艺术字key枚举
{
    主界面Test,
}